﻿//Copyright 2012 Koolearn api test
//
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace KoolearnSample.Model
{
    /// <summary>
    /// 课程信息实体
    /// </summary>
    [DataContract]
    public class KoolearnCourse : INotifyPropertyChanged
    {
        #region Members
        [DataMember(Name = "id")]
        private string id;
        [DataMember(Name = "Name")]
        private string name;
        [DataMember(Name = "original_pic")]
        private string originalPic;
        [DataMember(Name = "thumbnail_pic")]
        private string thumbnailPic;
        [DataMember(Name = "video_url")]
        private string vedioUrl;
        #endregion

        #region Properties
        public string Id
        {
            get { return id; }
            set { id = value; RaisePropertyChanged("Id"); }
        }
        public string Name
        {
            get { return name; }
            set { name = value; RaisePropertyChanged("Name"); }
        }
        public string OriginalPic
        {
            get { return originalPic; }
            set { originalPic = value; RaisePropertyChanged("OriginalPic"); }
        }
        public string ThumbnailPic
        {
            get { return thumbnailPic; }
            set { thumbnailPic = value; RaisePropertyChanged("ThumbnailPic"); }
        }
        public string VedioUrl
        {
            get { return vedioUrl; }
            set { vedioUrl = value; RaisePropertyChanged("VedioUrl"); }
        }   
        #endregion
        
        #region INotifyPropertyChanged Members
        public event PropertyChangedEventHandler PropertyChanged;
        #endregion

        #region Methods
        public void RaisePropertyChanged(string name)
        {
            var handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }
        #endregion
    }
}
